<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr = [
        {
          environmentalNoise: 60.1,
          humanBodyInfrared: 0,
          laserRanging: 0.6431,
          metalDetection: 0,
          shearWave: 0.054306,
          longitudinalWave: 0.995809
        },
        {
          environmentalNoise: 51.6,
          humanBodyInfrared: 0,
          laserRanging: 0.8627,
          metalDetection: 0,
          shearWave: 0.051835,
          longitudinalWave: 0.997022
        },
        {
          environmentalNoise: 52.8,
          humanBodyInfrared: 0,
          laserRanging: 0.6575,
          metalDetection: 0,
          shearWave: 0.055677,
          longitudinalWave: 0.998308
        },
        {
          environmentalNoise: 47.1,
          humanBodyInfrared: 1,
          laserRanging: 0.7127,
          metalDetection: 0,
          shearWave: 0.053177,
          longitudinalWave: 0.997067
        },
        {
          environmentalNoise: 52.6,
          humanBodyInfrared: 1,
          laserRanging: 0.6847,
          metalDetection: 0,
          shearWave: 0.055674,
          longitudinalWave: 0.999527
        },
        {
          environmentalNoise: 47.2,
          humanBodyInfrared: 1,
          laserRanging: 0.68,
          metalDetection: 1,
          shearWave: 0.054516,
          longitudinalWave: 0.998333
        },
        {
          environmentalNoise: 47,
          humanBodyInfrared: 0,
          laserRanging: 0.68,
          metalDetection: 1,
          shearWave: 0.055746,
          longitudinalWave: 0.999556
        },
        {
          environmentalNoise: 47.5,
          humanBodyInfrared: 1,
          laserRanging: 0.6633,
          metalDetection: 1,
          shearWave: 0.055785,
          longitudinalWave: 0.99835
        },
        {
          environmentalNoise: 51,
          humanBodyInfrared: 1,
          laserRanging: 0.7075,
          metalDetection: 0,
          shearWave: 0.054552,
          longitudinalWave: 0.998347
        }
      ]

      const totalAverage = []

      const computeAverage = (arr) => {
        const handleMap = arr.map((item) => item.environmentalNoise)
        const res = handleMap.reduce((prev, current) => {
          return prev + current
        }, 0)
        return res / arr.length
      }

      const res = computeAverage(arr)
      console.log(res)
    </script>
  </body>
</html>
